import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    name:'home',
    redirect:'/Info/sy',
  },
  {
    path:'/Login',
    name:'Login',
    component:()=>import("@/views/login/login.vue")
  },
  {
    path:'/Register',
    name:'Register',
    component:()=>import("@/views/register/register.vue")
  },
  {
    path:'/Layout',
    name:'Layout',
    component:()=>import("@/views/layout/layoutIndex.vue"),
      //二级路由
    children:[
       {
        path:'/user/User',
        name:'User',
        component:()=>import("@/views/user/user.vue")
      }, 
      {
        path:'/user/guest',
        name:'guest',
        component:()=>import("@/views/user/guest.vue")
      },
      {
        path:'/user/roleSuperAdmin',
        name:'roleSuperAdmin',
        component:()=>import("@/views/user/roleSuperAdmin")
      },
      {
        path:'/Info/sy',
        name:'sy',
        component:()=>import("@/views/Info/sy.vue")
      },
      {
        path:'/Info/dataInfo',
        name:'dataInfo',
        component:()=>import("@/views/Info/dataInfo.vue")
      },
      {
        path:'/Info/dataTime',
        name:'dataTime',
        component:()=>import("@/views/Info/dataTime.vue")
      },
      {
        path:'/Info/JS',
        name:'JS',
        component:()=>import("@/views/Info/JS.vue")
      },
      {
        path:'/Info/log1',
        name:'log1',
        component:()=>import("@/views/Info/log1.vue")
      },
      {
        path:'/Info/log2',
        name:'log2',
        component:()=>import("@/views/Info/log2.vue")
      },
      {
        path:'/Info/user',
        name:'InfoUser',
        component:()=>import("@/views/Info/user.vue")
      },
      {
        path:'/Info/status',
        name:'status',
        component:()=>import("@/views/Info/status.vue")
      },
      {
        path:'/production/productionList',
        name:'productionList',
        component:()=>import("@/views/production/productionList.vue")
      },
      {
        path:'/production/productionType',
        name:'productionType',
        component:()=>import("@/views/production/productionType.vue")
      },
      {
        path:'/Gyroscope/GyroscopeDataInfo',
        name:'GyroscopeDataInfo',
        component:()=>import("@/views/Gyroscope/GyroscopeDataInfo.vue")
      },
      {
        path:'/Gyroscope/GyroscopeQT',
        name:'GyroscopeQT',
        component:()=>import("@/views/Gyroscope/GyroscopeQT.vue")
      },
    ]  
  },
  // 重定向
  {
    path:'/',
    component:()=>import("@/views/home/home.vue")
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
